﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using WP7Client.Helpers;

namespace WP7Client.Classes
{
    public class MSHPhoneApplicationPage : PhoneApplicationPage
    {
        protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            if (!NavigationHelper.CanShutdown && NavigationHelper.PreviousPage().Equals("/UserInterface/Pages/LoginPage.xaml"))
                e.Cancel = true;
            else
                NavigationHelper.PageBack();

            base.OnBackKeyPress(e);
        }
    }
}
